import 'package:fish_redux/fish_redux.dart';
import 'package:flutter/material.dart' hide Action;

import 'action.dart';
import 'state.dart';

Widget buildView(
    PayTeacherState state, Dispatch dispatch, ViewService viewService) {
  return Container(
    child: ListTile(
      title: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          SizedBox(height: 8),
          Row(
            children: <Widget>[
              Text(
                '订单号：',
                style: TextStyle(fontWeight: FontWeight.bold),
              ),
              Text(
                state.orderId,
                style: TextStyle(fontWeight: FontWeight.bold),
              ),
              Spacer(),
              Text(state.info)
            ],
          ),
          SizedBox(height: 8),
          Text(state.memberInfo),
          SizedBox(height: 8),
          Row(
            mainAxisSize: MainAxisSize.max,
            children: <Widget>[
              Text(
                state.status,
                style: TextStyle(color: Colors.grey, fontSize: 14),
              ),
              Spacer(),
              Text(
                state.ctime,
                style: TextStyle(color: Colors.grey, fontSize: 14),
              )
            ],
          )
        ],
      ),
      onTap: () => dispatch(PayActionCreator.onRead()),
    ),
  );
}
